package io.r2mo.test.common.controller.gen.productcat;

import io.r2mo.test.common.domain.ProductCatEntity;
import io.r2mo.spring.common.webflow.PostResponse;
import io.r2mo.typed.webflow.WebResponse;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import io.r2mo.test.common.enums.ProductCatType;

import io.r2mo.typed.json.JObject;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.UUID;
/**
 * <p>
 * ProductCat 响应
 * </p>
 *
 * @author lang
 * @since 2025-09-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "商品分类响应")
public class ProductCatCommonResponse extends PostResponse implements WebResponse<ProductCatEntity> {
    @Schema(description = "主键")
    private UUID id;
    @Schema(description = "编码")
    private String code;
    @Schema(description = "创建者")
    private UUID createdBy;
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;
    @Schema(description = "更新者")
    private UUID updatedBy;
    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;
    @Schema(description = "是否启用")
    private boolean enabled;
    private String name;
    private ProductCatType type;
    private String description;
    private String icon;
    private int sort;
    private BigDecimal amountMarket;
    private LocalDateTime publishAt;
    private UUID parentId;

    @Override
    @SuppressWarnings("unchecked")
    public ProductCatCommonResponse data(ProductCatEntity data) {
        this.readFrom(data);
        return this;
    }
}
